package com.share.shareplatform.sharegoods.dao;



import com.share.shareplatform.pojo.Goods;
import com.share.shareplatform.pojo.GoodsSpecial;
import com.share.shareplatform.pojo.Repertory;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface GoodsDao {
    Long addOne(Goods goods);
    Integer updateOne(Goods goods);
    Integer deleteOneById(Long id);
    Integer deleteAllByIds(List<Long> ids);
    Goods findOneById(Long id);
    List<Goods> findPage(@Param("start")Integer start, @Param("end")Integer end);//分页查询
    List<Goods> findAllDimByName(String name);
    List<Goods> findAllByBrandId(Long id);
    List<Goods> findAllByTypeId(Long id);
    @MapKey("id")
    Map<Long,Goods> findAllByIdAsMap(List<Long> ids);
    List<Goods> findAllByShopId(Long shopId);
    /*GoodsKind*/
    List<GoodsSpecial> findAllSpecialByKind(String kind);
    List<GoodsSpecial> findAllSpecial();
    Goods findOneSpecialById(Long id);
    Long addOneSpecial(GoodsSpecial goodsSpecial);
    Integer deleteOneSpecialById(Long id);

    int updateAllRepertory(List<Repertory> list);

}
